<template>

  <div class="card-goods-content"   @click="itemClick(order)">
    <img

      class="good-thumb"
      v-lazy="order.picUrl"
    />
    <div class="good-info">
      <div class="good-message">
        <div class="good-title"  >
          <span>{{ order.goodsName }}</span>
        </div>
        <div class="good-type"  >
          <span>{{ order.specifications.join(',') }}</span>
        </div>
      </div>
      <div class="good-counts">
        <span class="good-price">¥{{ order.price }}</span>

        <div>
          <span class="good-count">x{{ order.number }}</span>
        </div>
      </div>

    </div>
  </div>

</template>

<script>
export default {
  name: 'OrderItem',
  props: {
    order: Object
  },

  methods: {
    itemClick (item) {
      this.$emit('itemClick', item)
    }
  }
}
</script>

<style scoped>
.card-goods-content{
  display: flex;
  flex-grow: 1;
  flex-direction: row;
  margin-top: 10px;
}
.good-message{
  flex: 1;
}
.good-info {
  margin-left: 10px;
  flex-grow: 1;
  flex-direction: row;
  display: flex;
}

.good-counts {
  display: flex;
  flex-direction: column;
  text-align: right;
}

.good-price {
  color: #db3d3c;
  font-weight: bold;
}

.good-title {
  color: black;
  font-size: 14px;
  font-weight: bold;
}

.good-type {
  margin: 7px 0;
  border-radius: 3px;
  width: max-content;
  color: gray;
  font-size: 10px;
}

.good-thumb {
  width: 60px;
  height: 60px;
  border-radius: 10px;
}

</style>
